package com.fac.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 维修订单表
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("repair_orders")
@ApiModel(description = "维修工单实体类")
public class RepairOrder implements Serializable {

    /**
     * 订单ID
     */
    @TableId(value = "order_id", type = IdType.AUTO)
    @ApiModelProperty(value = "工单ID", example = "1")
    private Long orderId;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "工单编号", example = "REP202401010001", required = true)
    private String code;

    /**
     * 设备ID
     */
    @ApiModelProperty(value = "设备ID", example = "1", required = true)
    private Long equipmentId;

    /**
     * 报修用户ID
     */
    @ApiModelProperty(value = "报修用户ID", example = "1", required = true)
    private Long reportUserId;

    /**
     * 维修用户ID
     */
    @ApiModelProperty(value = "维修用户ID", example = "2")
    private Long repairUserId;

    /**
     * 故障描述
     */
    @ApiModelProperty(value = "故障描述", example = "设备无法启动", required = true)
    private String faultDescription;

    /**
     * 维修方案
     */
    @ApiModelProperty(value = "维修方案", example = "更换启动器")
    private String repairSolution;

    /**
     * 维修费用
     */
    @ApiModelProperty(value = "维修费用", example = "500.00")
    private BigDecimal repairFee;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间", example = "2024-01-01 12:00:00")
    private LocalDateTime startTime;

    /**
     * 完成时间
     */
    @ApiModelProperty(value = "完成时间", example = "2024-01-01 14:00:00")
    private LocalDateTime finishTime;

    /**
     * 状态：0待处理 1处理中 2已完成 3已取消
     */
    @ApiModelProperty(value = "状态：0待处理，1处理中，2已完成，3已取消", example = "0", required = true)
    private Integer status;

    /**
     * 优先级：0低 1中 2高
     */
    @ApiModelProperty(value = "优先级：0低，1中，2高", example = "1", required = true)
    private Integer priority;

    /**
     * 维修材料
     */
    @ApiModelProperty(value = "维修材料", example = "启动器*1，螺丝*4")
    private String repairMaterials;

    /**
     * 质检结果：0不合格 1合格
     */
    @ApiModelProperty(value = "质检结果：0不合格，1合格", example = "1")
    private Integer qualityCheckResult;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "2024-01-01 12:00:00")
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间", example = "2024-01-01 12:00:00")
    private LocalDateTime updatedAt;
} 